ccsini 0.1.44 → 0.1.45
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/index.js +26 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28020,7 +28020,7 @@ var {
|
|
|
28020
28020
|
} = import__.default;
|
|
28021
28021
|
|
|
28022
28022
|
// src/version.ts
|
|
28023
|
-
var VERSION = "0.1.
|
|
28023
|
+
var VERSION = "0.1.45";
|
|
28024
28024
|
|
|
28025
28025
|
// src/commands/init.ts
|
|
28026
28026
|
init_source();
|
|
@@ -29359,6 +29359,7 @@ async function pushSync(client, masterKey, deviceName, configDir, onProgress, se
|
|
|
29359
29359
|
const start = Date.now();
|
|
29360
29360
|
const claudeDir = getClaudeDir();
|
|
29361
29361
|
const errors2 = [];
|
|
29362
|
+
const conflicts = [];
|
|
29362
29363
|
let bytesTransferred = 0;
|
|
29363
29364
|
const progress = onProgress ?? (() => {});
|
|
29364
29365
|
const localManifest = await generateManifest(claudeDir, deviceName, progress, sessionOptions);
|
|
@@ -29393,6 +29394,7 @@ async function pushSync(client, masterKey, deviceName, configDir, onProgress, se
|
|
|
29393
29394
|
const conflictPath = join6(claudeDir, `${diff.path}.conflict`);
|
|
29394
29395
|
await mkdir2(dirname(conflictPath), { recursive: true });
|
|
29395
29396
|
await writeFile5(conflictPath, decrypted);
|
|
29397
|
+
conflicts.push(diff.path);
|
|
29396
29398
|
progress(`Saved conflict backup: ${diff.path}.conflict`);
|
|
29397
29399
|
} catch {}
|
|
29398
29400
|
}
|
|
@@ -29453,13 +29455,15 @@ async function pushSync(client, masterKey, deviceName, configDir, onProgress, se
|
|
|
29453
29455
|
filesChanged: toPush.length,
|
|
29454
29456
|
bytesTransferred,
|
|
29455
29457
|
durationMs,
|
|
29456
|
-
errors: errors2
|
|
29458
|
+
errors: errors2,
|
|
29459
|
+
conflicts
|
|
29457
29460
|
};
|
|
29458
29461
|
}
|
|
29459
29462
|
async function pullSync(client, masterKey, deviceName, configDir, onProgress, sessionOptions) {
|
|
29460
29463
|
const start = Date.now();
|
|
29461
29464
|
const claudeDir = getClaudeDir();
|
|
29462
29465
|
const errors2 = [];
|
|
29466
|
+
const conflicts = [];
|
|
29463
29467
|
let bytesTransferred = 0;
|
|
29464
29468
|
const progress = onProgress ?? (() => {});
|
|
29465
29469
|
progress("Fetching remote manifest...");
|
|
@@ -29470,7 +29474,8 @@ async function pullSync(client, masterKey, deviceName, configDir, onProgress, se
|
|
|
29470
29474
|
filesChanged: 0,
|
|
29471
29475
|
bytesTransferred: 0,
|
|
29472
29476
|
durationMs: Date.now() - start,
|
|
29473
|
-
errors: []
|
|
29477
|
+
errors: [],
|
|
29478
|
+
conflicts: []
|
|
29474
29479
|
};
|
|
29475
29480
|
}
|
|
29476
29481
|
let remoteManifest;
|
|
@@ -29485,7 +29490,8 @@ async function pullSync(client, masterKey, deviceName, configDir, onProgress, se
|
|
|
29485
29490
|
durationMs: Date.now() - start,
|
|
29486
29491
|
errors: [
|
|
29487
29492
|
"Failed to decrypt remote manifest - wrong encryption password?"
|
|
29488
|
-
]
|
|
29493
|
+
],
|
|
29494
|
+
conflicts: []
|
|
29489
29495
|
};
|
|
29490
29496
|
}
|
|
29491
29497
|
progress("Loading local manifest...");
|
|
@@ -29525,12 +29531,14 @@ async function pullSync(client, masterKey, deviceName, configDir, onProgress, se
|
|
|
29525
29531
|
const result = mergeLastWriteWins(localContent, remoteContent, localEntry.modified, entry.modified);
|
|
29526
29532
|
await writeFile5(localPath2, result.content);
|
|
29527
29533
|
await writeFile5(`${localPath2}.conflict`, result.backupContent);
|
|
29534
|
+
conflicts.push(diff.path);
|
|
29528
29535
|
downloaded++;
|
|
29529
29536
|
progress(`Downloading ${downloaded}/${toPull.length}: ${diff.path}`);
|
|
29530
29537
|
return;
|
|
29531
29538
|
}
|
|
29532
29539
|
await writeFile5(`${localPath2}.conflict`, localContent);
|
|
29533
29540
|
await writeFile5(localPath2, remoteContent);
|
|
29541
|
+
conflicts.push(diff.path);
|
|
29534
29542
|
downloaded++;
|
|
29535
29543
|
progress(`Downloading ${downloaded}/${toPull.length}: ${diff.path} (conflict saved)`);
|
|
29536
29544
|
return;
|
|
@@ -29560,7 +29568,8 @@ async function pullSync(client, masterKey, deviceName, configDir, onProgress, se
|
|
|
29560
29568
|
filesChanged: toPull.length,
|
|
29561
29569
|
bytesTransferred,
|
|
29562
29570
|
durationMs,
|
|
29563
|
-
errors: errors2
|
|
29571
|
+
errors: errors2,
|
|
29572
|
+
conflicts
|
|
29564
29573
|
};
|
|
29565
29574
|
}
|
|
29566
29575
|
function chunkArray(arr, size) {
|
|
@@ -29947,6 +29956,9 @@ function registerAutoCommands(program2) {
|
|
|
29947
29956
|
if (result.filesChanged > 0) {
|
|
29948
29957
|
console.log(`[ccsini] Pulled ${result.filesChanged} files (${result.durationMs}ms)`);
|
|
29949
29958
|
}
|
|
29959
|
+
if (result.conflicts.length > 0) {
|
|
29960
|
+
console.log(`[ccsini] \u26A0 ${result.conflicts.length} conflict(s) \u2014 check .conflict files in ~/.claude/`);
|
|
29961
|
+
}
|
|
29950
29962
|
} catch {}
|
|
29951
29963
|
});
|
|
29952
29964
|
program2.command("auto-push").description("Auto-push changes (called by Claude Code hooks)").action(async () => {
|
|
@@ -29967,6 +29979,9 @@ function registerAutoCommands(program2) {
|
|
|
29967
29979
|
if (result.filesChanged > 0) {
|
|
29968
29980
|
console.log(`[ccsini] Pushed ${result.filesChanged} files (${result.durationMs}ms)`);
|
|
29969
29981
|
}
|
|
29982
|
+
if (result.conflicts.length > 0) {
|
|
29983
|
+
console.log(`[ccsini] \u26A0 ${result.conflicts.length} conflict(s) \u2014 check .conflict files in ~/.claude/`);
|
|
29984
|
+
}
|
|
29970
29985
|
} catch {}
|
|
29971
29986
|
});
|
|
29972
29987
|
program2.command("unlock").description("Enter encryption password to enable auto-sync").action(async () => {
|
|
@@ -30231,6 +30246,9 @@ function registerSyncCommands(program2) {
|
|
|
30231
30246
|
if (sessionOptions.enabled) {
|
|
30232
30247
|
console.log(chalk2.dim(" Sessions: enabled"));
|
|
30233
30248
|
}
|
|
30249
|
+
if (result.conflicts.length > 0) {
|
|
30250
|
+
console.log(chalk2.yellow(` \u26A0 ${result.conflicts.length} conflict(s) \u2014 check .conflict files in ~/.claude/`));
|
|
30251
|
+
}
|
|
30234
30252
|
} catch (e) {
|
|
30235
30253
|
console.error(`Push failed: ${e.message}`);
|
|
30236
30254
|
process.exit(1);
|
|
@@ -30270,6 +30288,9 @@ function registerSyncCommands(program2) {
|
|
|
30270
30288
|
if (sessionOptions.enabled) {
|
|
30271
30289
|
console.log(chalk2.dim(" Sessions: enabled"));
|
|
30272
30290
|
}
|
|
30291
|
+
if (result.conflicts.length > 0) {
|
|
30292
|
+
console.log(chalk2.yellow(` \u26A0 ${result.conflicts.length} conflict(s) \u2014 check .conflict files in ~/.claude/`));
|
|
30293
|
+
}
|
|
30273
30294
|
} catch (e) {
|
|
30274
30295
|
console.error(`Pull failed: ${e.message}`);
|
|
30275
30296
|
process.exit(1);
|